package org.jsbd.boss.action;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import org.jsbd.boss.common.ResponseUtils;
import org.jsbd.boss.domian.channel.BaseResultVo;
import org.jsbd.boss.domian.channel.SimulatorGoogleADLog;
import org.jsbd.boss.domian.channel.SimulatorGoogleADStatistics;
import org.jsbd.boss.service.ISimulatorGoogleADLogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
/**
 * 
 * TODO 请加入本类的说明
 * @author <a href="mailto:zhangbinghua@zhexinit.com" >zbh</a>
 * @version 1.0.0
 */
@Controller
@RequestMapping("/googleadlog")
public class SimulatorGoogleLogController {
	public static final Logger LOGGER = LoggerFactory.getLogger(SimulatorGoogleLogController.class);
	@Resource
	private ISimulatorGoogleADLogService simulatorGoogleADLog;
	

	@RequestMapping(value = "/save", method = RequestMethod.POST)
	public void saveLog(HttpServletResponse response, SimulatorGoogleADLog log) {
		BaseResultVo resultVo = new BaseResultVo();
		simulatorGoogleADLog.batchInsert(log);
		ResponseUtils.renderJson(response, resultVo.toString());
	}
	
	@RequestMapping(value = "/list", method = RequestMethod.GET)
  	public String toPage() {
  		return "googleadlog/list";
  	}
	@RequestMapping(value = "/list", params = "json")
	@ResponseBody
	public List<SimulatorGoogleADStatistics>  list(Model model, SimulatorGoogleADStatistics log) {
  		
		return simulatorGoogleADLog.getGoogleAD(log);
	}
	
}
